<?php
class StringUtils {
	
	public static function endWith($str, $end) {
		return substr($str, strlen($str) - strlen($end)) == $end;
	}

	/**
	 * Method to return the last occurrence of a substring within a string
	*/
	public static function lastIndexOf($string, $item) {
		$index = strpos(strrev($string), strrev($item));
		if ($index) {
			$index = strlen($string) - strlen($item) - $index;
			return $index;
		}
		return -1;
	}
}
?>